import { createApp } from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import icoFontPlugin from '@/plugins/icoFontPlugin'
import markdown from '@/plugins/markdown'
import commonDialog from '@/plugins/commonDialog'
import commonDrawer from '@/plugins/commonDrawer'
import router from './router'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import permission from '@/permission'
import 'animate.css'

const app = createApp(App)
router.beforeEach((to, from, next) => {
  NProgress.start()
  permission(to, from, next)
})
router.afterEach(() => {
  NProgress.done()
})
app
  .use(store)
  .use(router)
  .use(icoFontPlugin)
  .use(markdown)
  .use(commonDialog)
  .use(commonDrawer)
  .use(ElementPlus)
  .mount('#app')
